import { createStore } from 'vuex'
/**
 * 模板文件直接使用  $vuex.state.globalData.tabBar.list
 * js使用 <script setup>uni.$vuex.state.globalData.test</script>  
 */
const store = createStore({
  state: {
    globalData: {
		// 网络状态:0未连接,1已连接,2已断开连接
		netStateChange:1,
		//登录状态
		imLoginStatus:false,
		//当前登录的用户
		user:{
			user_id:'',
			nickname:'',
			head_pic:''
		},
		//会话列表
		conversationList:[],
		//当前正在聊天的会话ID
		currentConversId:"",
		// 会话是否已同步
		isSyncCompleted:false,
		//即时通信消息列表
		messageList:[],
		// 滚动条
		scrollTopValue:0,
		//是否显示新消息回弹到底按钮
		showToBottom:0,
		//商机列表用户所选择的城市
		businessCity:{},
		//自定义底部导航 https://vkuviewdoc.fsq.pub/components/tabbar.html
		tabBar:{
			list:[
				{
					iconPath: "/static/image/communication.png",
					selectedIconPath: "/static/image/communication_new.png",
					text: '消息',
					count: 0,
					isDot: false,
					customIcon: false,
					pagePath: '/pages/message/message',
				},
				{
					iconPath: "/static/image/peoplestwo.png",
					selectedIconPath: "/static/image/peoplestwo_now.png",
					text: '社群',
					count: 0,
					isDot: false,
					customIcon: false,
					pagePath: '/pages/group/group',
				},
				{
					iconPath: "/static/image/trend.png",
					selectedIconPath: "/static/image/trend_now.png",
					text: '商机',
					count: 0,
					isDot: false,
					customIcon: false,
					pagePath: '/pages/business/business',
				},
				{
					iconPath: "/static/image/people.png",
					selectedIconPath: "/static/image/people_now.png",
					text: '我的',
					count: 0,
					isDot: false,
					customIcon: false,
					pagePath: '/pages/user/user',
				},
			],
			current: 0
		},
		groupApplicationCount:0,
	}
  },
  mutations: { // 你的mutations函数，用于直接改变状态
   
  },
  actions: { // 你的actions函数，用于间接调用mutations或者异步操作

  },
  getters: {
      // 你的getters函数，用于从状态派生出一些状态
  }
});
uni.$vuex=store; 
